package com.jun.admin.core.controller;

import com.jun.admin.core.model.vo.OrgTreeVo;
import com.jun.admin.core.service.OrgService;
import com.jun.common.core.entity.page.ResultHelper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author yuejun.li
 * @date 2024/10/15 14:25:00
 */
@Api(tags = "机构controller")
@RestController
@RequestMapping("org")
@AllArgsConstructor
@Slf4j
public class OrgController {

    private OrgService orgService;

    @ApiOperation("机构树返回")
    @GetMapping("tree")
    public ResultHelper<List<OrgTreeVo>> tree(){
        return ResultHelper.success(orgService.tree());
    }
}
